/*
 * Copyright (c) 2016- 2020 qolome.com Inc. All Rights Reserved.
 * ProjectName: qolome-knowledge
 * FileName: TrainTicket.java
 * Author: jiangfeng@qolome.com
 * Date: 2020/3/9 下午3:55
 * LastModified: 2020/03/09 15:55:09
 */

package com.qolome.knowledge.design.pattern.flyweight.ticket;

import lombok.extern.slf4j.Slf4j;

import java.util.Random;

/**
 * @author Qolome
 * @version V1.0
 * @Description 火车票
 * @date 2020年 03月09日 15:55:03
 */
@Slf4j
public class TrainTicket implements  ITicket{

    public TrainTicket(String from, String to) {
        this.from = from;
        this.to = to;
    }

    private String from;
    private String to;
    private int price;



    @Override
    public void showInfo(String bunk) {
        this.price = new Random().nextInt(500);
        log.info("票面信息: form:{}, to:{}, bunk:{}, price:{}",from,to,bunk,this.price);
    }
}
